<?php
	/**
	* 系统配合模块
	*/
	
	class System_model extends CI_Model{
		function __construct(){
			$this->load->database();
		}
		
		//获取配置项
		function getConfig($name = FALSE){
			if($name){
				$this->db->where('name',$name);
				$query = $this->db->get('system_config');
				return $query->row_array();
			}
			$query = $this->db->get('system_config');
			return $query->result_array();
		}
		
		//添加配置项
		function addConfig($data){
			return $this->db->insert('system_config',$data);
		}
		
		//更新配置项
		function updateConfig($name,$data){
			$this->db->where(array('name'=>$name));
			return $this->db->update('system',$data);
		}
	}
?>